home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 2 / Amiga Tools 2.iso / tools / mfrinced / insert_file_req.ced < prev    next >
Text File  |  1995-03-09  |  3KB  |  109 lines

  1.  
  2. /*««««««««««««««««««««  Insert_File_req.ced  »»»»»»»»»»»»»»»»»»»»»»»»»»»»»>
  3.  «                                                                       »
  4.  «    Program:          Insert_File_req.ced                              »
  5.  «    Abstract:         rexx prgm to use mfr in CED 3.5                  »
  6.  «    Author:           Benjamin Lear (BL)                               »
  7.  «    Version:        1.0                                              »
  8.  «    Status:         Public Domain , NO WARRENTY !!!                  »
  9.  «    Date:             17.8.1993                                        »
  10.  «    Last modified:    18.8.1993                                        »
  11.  «                                                                       »
  12.  ««««««««««««««««««««««««««   ««««« · »»»»»   »»»»»»»»»»»»»»»»»»»»»»»»»»»*/
  13.  
  14. /* NOTE:
  15. recommended to put this in your user-startup in order to increase speed:
  16. resident c:SetDefPubScreen PURE
  17. */
  18.  
  19. OPTIONS RESULTS
  20.  
  21. LF = '0A'X            /* line-feed */
  22.  
  23.  
  24. /*
  25. ADDRESS COMMAND "resident c:SetDefPubScreen PURE"
  26. */
  27.  
  28. IF ~show('l','rexxsupport.library') THEN 
  29. DO
  30.    CALL addlib('rexxsupport.library',0,-30)
  31. END
  32. IF ~show('l','rexxarplib.library') THEN 
  33. DO
  34.    CALL addlib('rexxarplib.library',0,-30)
  35. END
  36.  
  37.  
  38. /* Make sure the libraries are resident in memory ... */
  39. IF ~showlist('L','rexxarplib.library') THEN 
  40. DO
  41.    say "Loading RexxArpLib Library ..."
  42.    address command 'loadlib libs:screenshare.library'
  43.    address command 'loadlib libs:rexxarplib.library'
  44. END
  45.  
  46. IF ~show('l', "rexxarplib.library") THEN 
  47. DO
  48.   check = addlib('rexxsupport.library',0,-30,0) 
  49.   check = addlib('rexxmathlib.library',0,-30,0)
  50.   check = addlib('rexxarplib.library',0,-30,0)   
  51. END
  52.  
  53. IF ~show('l','req.library') THEN 
  54. DO
  55.    CALL addlib('req.library',0,-60)
  56. END
  57.  
  58.  
  59. STATUS 20             /* Dir of curr. CED - window  */
  60. curr_dir = result 
  61.  
  62. /* set a default directory : */
  63.  
  64. IF ( curr_dir = '') THEN
  65. DO
  66.   curr_dir = "T:"
  67. END
  68.  
  69. "Make screen public ?"         /* make CED - public : */
  70.  
  71. /* make CED - default public screen : */
  72. /* I'll be very glad, if someone could tell me how to do this in arexx */
  73.  
  74. ADDRESS COMMAND SetDefPubScreen CygnusEdScreen1
  75.  
  76. CALL filereq("Select a file to insert ...", curr_dir,'')   /* -> req.library functions */
  77. selected_file = result
  78.  
  79. ADDRESS COMMAND SetDefPubScreen $PUBLICSCREEN 
  80.  
  81. "use custom scrolling routines?"
  82.  
  83. /* loading selected file: */
  84.  
  85. IF ( selected_file ~= '' ) THEN
  86. DO
  87.  
  88.   OPEN( "sel", selected_file, "R" )
  89.  
  90.   IF ~EOF( "sel" ) THEN 
  91.   DO
  92.     DO lines = 1 UNTIL EOF("sel")
  93.  
  94.        inp_str = READLN( "sel")
  95.  
  96.        IF ~EOF("sel") THEN DO
  97.           TEXT inp_str || LF    /* TEXT is a function of CED !!   */
  98.        END
  99.  
  100.     END
  101.   END
  102.  
  103.   CLOSE( "sel" )
  104.  
  105. END 
  106.  
  107. EXIT 0
  108. /*                          ««« THE · END »»»                */
  109.